<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>
MultipartStream (Commons FileUpload 1.3 API)
</TITLE>


<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="MultipartStream (Commons FileUpload 1.3 API)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/MultipartStream.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../org/apache/commons/fileupload/InvalidFileNameException.html" title="class in org.apache.commons.fileupload"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/commons/fileupload/MultipartStream.IllegalBoundaryException.html" title="class in org.apache.commons.fileupload"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html?org/apache/commons/fileupload/MultipartStream.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="MultipartStream.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.commons.fileupload</FONT>
<BR>
Class MultipartStream</H2>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
  <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.commons.fileupload.MultipartStream</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>MultipartStream</B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
</PRE>

<P>
<p> Low level API for processing file uploads.

 <p> This class can be used to process data streams conforming to MIME
 'multipart' format as defined in
 <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>. Arbitrarily
 large amounts of data in the stream can be processed under constant
 memory usage.

 <p> The format of the stream is defined in the following way:<br>

 <code>
   multipart-body := preamble 1*encapsulation close-delimiter epilogue<br>
   encapsulation := delimiter body CRLF<br>
   delimiter := "--" boundary CRLF<br>
   close-delimiter := "--" boundary "--"<br>
   preamble := &lt;ignore&gt;<br>
   epilogue := &lt;ignore&gt;<br>
   body := header-part CRLF body-part<br>
   header-part := 1*header CRLF<br>
   header := header-name ":" header-value<br>
   header-name := &lt;printable ascii characters except ":"&gt;<br>
   header-value := &lt;any ascii characters except CR & LF&gt;<br>
   body-data := &lt;arbitrary data&gt;<br>
 </code>

 <p>Note that body-data can contain another mulipart entity.  There
 is limited support for single pass processing of such nested
 streams.  The nested stream is <strong>required</strong> to have a
 boundary token of the same length as the parent stream (see <A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#setBoundary(byte[])"><CODE>setBoundary(byte[])</CODE></A>).

 <p>Here is an example of usage of this class.<br>

 <pre>
   try {
     MultipartStream multipartStream = new MultipartStream(input, boundary);
     boolean nextPart = multipartStream.skipPreamble();
     OutputStream output;
     while(nextPart) {
       String header = multipartStream.readHeaders();
       // process headers
       // create some output stream
       multipartStream.readBodyData(output);
       nextPart = multipartStream.readBoundary();
     }
   } catch(MultipartStream.MalformedStreamException e) {
     // the stream failed to follow required syntax
   } catch(IOException e) {
     // a read or write error occurred
   }
 </pre>
<P>

<P>
<DL>
<DT><B>Version:</B></DT>
  <DD>$Id: MultipartStream.java 1456933 2013-03-15 12:36:11Z markt $</DD>
</DL>
<HR>

<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->

<A NAME="nested_class_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Nested Class Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.IllegalBoundaryException.html" title="class in org.apache.commons.fileupload">MultipartStream.IllegalBoundaryException</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thrown upon attempt of setting an invalid boundary token.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.ItemInputStream.html" title="class in org.apache.commons.fileupload">MultipartStream.ItemInputStream</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;An <A HREF="http://download.oracle.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io"><CODE>InputStream</CODE></A> for reading an items contents.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.MalformedStreamException.html" title="class in org.apache.commons.fileupload">MultipartStream.MalformedStreamException</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thrown to indicate that the input stream fails to follow the
 required syntax.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.ProgressNotifier.html" title="class in org.apache.commons.fileupload">MultipartStream.ProgressNotifier</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Internal class, which is used to invoke the
 <A HREF="../../../../org/apache/commons/fileupload/ProgressListener.html" title="interface in org.apache.commons.fileupload"><CODE>ProgressListener</CODE></A>.</TD>
</TR>
</TABLE>
&nbsp;<!-- =========== FIELD SUMMARY =========== -->

<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected static&nbsp;byte[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#BOUNDARY_PREFIX">BOUNDARY_PREFIX</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A byte sequence that precedes a boundary (<code>CRLF--</code>).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;byte</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#CR">CR</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The Carriage Return ASCII character value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;byte</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#DASH">DASH</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The dash (-) ASCII character value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#DEFAULT_BUFSIZE">DEFAULT_BUFSIZE</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The default length of the buffer used for processing a request.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected static&nbsp;byte[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#FIELD_SEPARATOR">FIELD_SEPARATOR</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A byte sequence that that follows a delimiter that will be
 followed by an encapsulation (<code>CRLF</code>).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#HEADER_PART_SIZE_MAX">HEADER_PART_SIZE_MAX</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The maximum length of <code>header-part</code> that will be
 processed (10 kilobytes = 10240 bytes.).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected static&nbsp;byte[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#HEADER_SEPARATOR">HEADER_SEPARATOR</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A byte sequence that marks the end of <code>header-part</code>
 (<code>CRLFCRLF</code>).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;byte</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#LF">LF</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The Line Feed ASCII character value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected static&nbsp;byte[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#STREAM_TERMINATOR">STREAM_TERMINATOR</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A byte sequence that that follows a delimiter of the last
 encapsulation in the stream (<code>--</code>).</TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#MultipartStream()">MultipartStream</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>1.2.1 Use <A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#MultipartStream(java.io.InputStream, byte[], org.apache.commons.fileupload.MultipartStream.ProgressNotifier)"><CODE>MultipartStream(InputStream, byte[],
 org.apache.commons.fileupload.MultipartStream.ProgressNotifier)</CODE></A>,
 or <A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#MultipartStream(java.io.InputStream, byte[], int, org.apache.commons.fileupload.MultipartStream.ProgressNotifier)"><CODE>MultipartStream(InputStream, byte[], int,
 org.apache.commons.fileupload.MultipartStream.ProgressNotifier)</CODE></A></I></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#MultipartStream(java.io.InputStream, byte[])">MultipartStream</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A>&nbsp;input,
                byte[]&nbsp;boundary)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>1.2.1 Use <A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#MultipartStream(java.io.InputStream, byte[], org.apache.commons.fileupload.MultipartStream.ProgressNotifier)"><CODE>MultipartStream(InputStream, byte[],
  MultipartStream.ProgressNotifier)</CODE></A>.</I></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#MultipartStream(java.io.InputStream, byte[], int)">MultipartStream</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A>&nbsp;input,
                byte[]&nbsp;boundary,
                int&nbsp;bufSize)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>1.2.1 Use <A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#MultipartStream(java.io.InputStream, byte[], int, org.apache.commons.fileupload.MultipartStream.ProgressNotifier)"><CODE>MultipartStream(InputStream, byte[], int,
  org.apache.commons.fileupload.MultipartStream.ProgressNotifier)</CODE></A>.</I></TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#arrayequals(byte[], byte[], int)">arrayequals</A></B>(byte[]&nbsp;a,
            byte[]&nbsp;b,
            int&nbsp;count)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compares <code>count</code> first bytes in the arrays
 <code>a</code> and <code>b</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#discardBodyData()">discardBodyData</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Reads <code>body-data</code> from the current
 <code>encapsulation</code> and discards it.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#findByte(byte, int)">findByte</A></B>(byte&nbsp;value,
         int&nbsp;pos)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Searches for a byte of specified value in the <code>buffer</code>,
 starting at the specified <code>position</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#findSeparator()">findSeparator</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Searches for the <code>boundary</code> in the <code>buffer</code>
 region delimited by <code>head</code> and <code>tail</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#getHeaderEncoding()">getHeaderEncoding</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves the character encoding used when reading the headers of an
 individual part.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#readBodyData(java.io.OutputStream)">readBodyData</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A>&nbsp;output)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reads <code>body-data</code> from the current
 <code>encapsulation</code> and writes its contents into the
 output <code>Stream</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#readBoundary()">readBoundary</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Skips a <code>boundary</code> token, and checks whether more
 <code>encapsulations</code> are contained in the stream.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;byte</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#readByte()">readByte</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reads a byte from the <code>buffer</code>, and refills it as
 necessary.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#readHeaders()">readHeaders</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reads the <code>header-part</code> of the current
 <code>encapsulation</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#setBoundary(byte[])">setBoundary</A></B>(byte[]&nbsp;boundary)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Changes the boundary token used for partitioning the stream.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#setHeaderEncoding(java.lang.String)">setHeaderEncoding</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;encoding)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specifies the character encoding to be used when reading the headers of
 individual parts.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#skipPreamble()">skipPreamble</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Finds the beginning of the first <code>encapsulation</code>.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->

<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="CR"><!-- --></A><H3>
CR</H3>
<PRE>
public static final byte <B>CR</B></PRE>
<DL>
<DD>The Carriage Return ASCII character value.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.commons.fileupload.MultipartStream.CR">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="LF"><!-- --></A><H3>
LF</H3>
<PRE>
public static final byte <B>LF</B></PRE>
<DL>
<DD>The Line Feed ASCII character value.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.commons.fileupload.MultipartStream.LF">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="DASH"><!-- --></A><H3>
DASH</H3>
<PRE>
public static final byte <B>DASH</B></PRE>
<DL>
<DD>The dash (-) ASCII character value.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.commons.fileupload.MultipartStream.DASH">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="HEADER_PART_SIZE_MAX"><!-- --></A><H3>
HEADER_PART_SIZE_MAX</H3>
<PRE>
public static final int <B>HEADER_PART_SIZE_MAX</B></PRE>
<DL>
<DD>The maximum length of <code>header-part</code> that will be
 processed (10 kilobytes = 10240 bytes.).
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.commons.fileupload.MultipartStream.HEADER_PART_SIZE_MAX">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="DEFAULT_BUFSIZE"><!-- --></A><H3>
DEFAULT_BUFSIZE</H3>
<PRE>
protected static final int <B>DEFAULT_BUFSIZE</B></PRE>
<DL>
<DD>The default length of the buffer used for processing a request.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.commons.fileupload.MultipartStream.DEFAULT_BUFSIZE">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="HEADER_SEPARATOR"><!-- --></A><H3>
HEADER_SEPARATOR</H3>
<PRE>
protected static final byte[] <B>HEADER_SEPARATOR</B></PRE>
<DL>
<DD>A byte sequence that marks the end of <code>header-part</code>
 (<code>CRLFCRLF</code>).
<P>
<DL>
</DL>
</DL>
<HR>

<A NAME="FIELD_SEPARATOR"><!-- --></A><H3>
FIELD_SEPARATOR</H3>
<PRE>
protected static final byte[] <B>FIELD_SEPARATOR</B></PRE>
<DL>
<DD>A byte sequence that that follows a delimiter that will be
 followed by an encapsulation (<code>CRLF</code>).
<P>
<DL>
</DL>
</DL>
<HR>

<A NAME="STREAM_TERMINATOR"><!-- --></A><H3>
STREAM_TERMINATOR</H3>
<PRE>
protected static final byte[] <B>STREAM_TERMINATOR</B></PRE>
<DL>
<DD>A byte sequence that that follows a delimiter of the last
 encapsulation in the stream (<code>--</code>).
<P>
<DL>
</DL>
</DL>
<HR>

<A NAME="BOUNDARY_PREFIX"><!-- --></A><H3>
BOUNDARY_PREFIX</H3>
<PRE>
protected static final byte[] <B>BOUNDARY_PREFIX</B></PRE>
<DL>
<DD>A byte sequence that precedes a boundary (<code>CRLF--</code>).
<P>
<DL>
</DL>
</DL>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="MultipartStream()"><!-- --></A><H3>
MultipartStream</H3>
<PRE>
<FONT SIZE="-1"><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</A>
</FONT>public <B>MultipartStream</B>()</PRE>
<DL>
<DD><B>Deprecated.</B>&nbsp;<I>1.2.1 Use <A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#MultipartStream(java.io.InputStream, byte[], org.apache.commons.fileupload.MultipartStream.ProgressNotifier)"><CODE>MultipartStream(InputStream, byte[],
 org.apache.commons.fileupload.MultipartStream.ProgressNotifier)</CODE></A>,
 or <A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#MultipartStream(java.io.InputStream, byte[], int, org.apache.commons.fileupload.MultipartStream.ProgressNotifier)"><CODE>MultipartStream(InputStream, byte[], int,
 org.apache.commons.fileupload.MultipartStream.ProgressNotifier)</CODE></A></I>
<P>
<DD>Creates a new instance.
<P>
</DL>
<HR>

<A NAME="MultipartStream(java.io.InputStream, byte[], int)"><!-- --></A><H3>
MultipartStream</H3>
<PRE>
<FONT SIZE="-1"><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</A>
</FONT>public <B>MultipartStream</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A>&nbsp;input,
                                  byte[]&nbsp;boundary,
                                  int&nbsp;bufSize)</PRE>
<DL>
<DD><B>Deprecated.</B>&nbsp;<I>1.2.1 Use <A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#MultipartStream(java.io.InputStream, byte[], int, org.apache.commons.fileupload.MultipartStream.ProgressNotifier)"><CODE>MultipartStream(InputStream, byte[], int,
  org.apache.commons.fileupload.MultipartStream.ProgressNotifier)</CODE></A>.</I>
<P>
<DD><p> Constructs a <code>MultipartStream</code> with a custom size buffer
 and no progress notifier.

 <p> Note that the buffer must be at least big enough to contain the
 boundary string, plus 4 characters for CR/LF and double dash, plus at
 least one byte of data.  Too small a buffer size setting will degrade
 performance.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>input</CODE> - The <code>InputStream</code> to serve as a data source.<DD><CODE>boundary</CODE> - The token used for dividing the stream into
                 <code>encapsulations</code>.<DD><CODE>bufSize</CODE> - The size of the buffer to be used, in bytes.<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#MultipartStream(java.io.InputStream, byte[], org.apache.commons.fileupload.MultipartStream.ProgressNotifier)"><CODE>MultipartStream(InputStream, byte[],
   MultipartStream.ProgressNotifier)</CODE></A></DL>
</DL>
<HR>

<A NAME="MultipartStream(java.io.InputStream, byte[])"><!-- --></A><H3>
MultipartStream</H3>
<PRE>
<FONT SIZE="-1"><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</A>
</FONT>public <B>MultipartStream</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A>&nbsp;input,
                                  byte[]&nbsp;boundary)</PRE>
<DL>
<DD><B>Deprecated.</B>&nbsp;<I>1.2.1 Use <A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#MultipartStream(java.io.InputStream, byte[], org.apache.commons.fileupload.MultipartStream.ProgressNotifier)"><CODE>MultipartStream(InputStream, byte[],
  MultipartStream.ProgressNotifier)</CODE></A>.</I>
<P>
<DD><p> Constructs a <code>MultipartStream</code> with a default size buffer.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>input</CODE> - The <code>InputStream</code> to serve as a data source.<DD><CODE>boundary</CODE> - The token used for dividing the stream into
                 <code>encapsulations</code>.<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#MultipartStream(java.io.InputStream, byte[], int, org.apache.commons.fileupload.MultipartStream.ProgressNotifier)"><CODE>MultipartStream(InputStream, byte[], int,
  MultipartStream.ProgressNotifier)</CODE></A></DL>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="getHeaderEncoding()"><!-- --></A><H3>
getHeaderEncoding</H3>
<PRE>
public <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>getHeaderEncoding</B>()</PRE>
<DL>
<DD>Retrieves the character encoding used when reading the headers of an
 individual part. When not specified, or <code>null</code>, the platform
 default encoding is used.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>The encoding used to read part headers.</DL>
</DD>
</DL>
<HR>

<A NAME="setHeaderEncoding(java.lang.String)"><!-- --></A><H3>
setHeaderEncoding</H3>
<PRE>
public void <B>setHeaderEncoding</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;encoding)</PRE>
<DL>
<DD>Specifies the character encoding to be used when reading the headers of
 individual parts. When not specified, or <code>null</code>, the platform
 default encoding is used.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>encoding</CODE> - The encoding used to read part headers.</DL>
</DD>
</DL>
<HR>

<A NAME="readByte()"><!-- --></A><H3>
readByte</H3>
<PRE>
public byte <B>readByte</B>()
              throws <A HREF="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
<DL>
<DD>Reads a byte from the <code>buffer</code>, and refills it as
 necessary.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>The next byte from the input stream.
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE> - if there is no more data available.</DL>
</DD>
</DL>
<HR>

<A NAME="readBoundary()"><!-- --></A><H3>
readBoundary</H3>
<PRE>
public boolean <B>readBoundary</B>()
                     throws <A HREF="../../../../org/apache/commons/fileupload/FileUploadBase.FileUploadIOException.html" title="class in org.apache.commons.fileupload">FileUploadBase.FileUploadIOException</A>,
                            <A HREF="../../../../org/apache/commons/fileupload/MultipartStream.MalformedStreamException.html" title="class in org.apache.commons.fileupload">MultipartStream.MalformedStreamException</A></PRE>
<DL>
<DD>Skips a <code>boundary</code> token, and checks whether more
 <code>encapsulations</code> are contained in the stream.
<P>
<DD><DL>

<DT><B>Returns:</B><DD><code>true</code> if there are more encapsulations in
         this stream; <code>false</code> otherwise.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../org/apache/commons/fileupload/FileUploadBase.FileUploadIOException.html" title="class in org.apache.commons.fileupload">FileUploadBase.FileUploadIOException</A></CODE> - if the bytes read from the stream exceeded the size limits
<DD><CODE><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.MalformedStreamException.html" title="class in org.apache.commons.fileupload">MultipartStream.MalformedStreamException</A></CODE> - if the stream ends unexpectedly or
                                  fails to follow required syntax.</DL>
</DD>
</DL>
<HR>

<A NAME="setBoundary(byte[])"><!-- --></A><H3>
setBoundary</H3>
<PRE>
public void <B>setBoundary</B>(byte[]&nbsp;boundary)
                 throws <A HREF="../../../../org/apache/commons/fileupload/MultipartStream.IllegalBoundaryException.html" title="class in org.apache.commons.fileupload">MultipartStream.IllegalBoundaryException</A></PRE>
<DL>
<DD><p>Changes the boundary token used for partitioning the stream.

 <p>This method allows single pass processing of nested multipart
 streams.

 <p>The boundary token of the nested stream is <code>required</code>
 to be of the same length as the boundary token in parent stream.

 <p>Restoring the parent stream boundary token after processing of a
 nested stream is left to the application.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>boundary</CODE> - The boundary to be used for parsing of the nested
                 stream.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.IllegalBoundaryException.html" title="class in org.apache.commons.fileupload">MultipartStream.IllegalBoundaryException</A></CODE> - if the <code>boundary</code>
                                  has a different length than the one
                                  being currently parsed.</DL>
</DD>
</DL>
<HR>

<A NAME="readHeaders()"><!-- --></A><H3>
readHeaders</H3>
<PRE>
public <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>readHeaders</B>()
                   throws <A HREF="../../../../org/apache/commons/fileupload/FileUploadBase.FileUploadIOException.html" title="class in org.apache.commons.fileupload">FileUploadBase.FileUploadIOException</A>,
                          <A HREF="../../../../org/apache/commons/fileupload/MultipartStream.MalformedStreamException.html" title="class in org.apache.commons.fileupload">MultipartStream.MalformedStreamException</A></PRE>
<DL>
<DD><p>Reads the <code>header-part</code> of the current
 <code>encapsulation</code>.

 <p>Headers are returned verbatim to the input stream, including the
 trailing <code>CRLF</code> marker. Parsing is left to the
 application.

 <p><strong>TODO</strong> allow limiting maximum header size to
 protect against abuse.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>The <code>header-part</code> of the current encapsulation.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../org/apache/commons/fileupload/FileUploadBase.FileUploadIOException.html" title="class in org.apache.commons.fileupload">FileUploadBase.FileUploadIOException</A></CODE> - if the bytes read from the stream exceeded the size limits.
<DD><CODE><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.MalformedStreamException.html" title="class in org.apache.commons.fileupload">MultipartStream.MalformedStreamException</A></CODE> - if the stream ends unexpectedly.</DL>
</DD>
</DL>
<HR>

<A NAME="readBodyData(java.io.OutputStream)"><!-- --></A><H3>
readBodyData</H3>
<PRE>
public int <B>readBodyData</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A>&nbsp;output)
                 throws <A HREF="../../../../org/apache/commons/fileupload/MultipartStream.MalformedStreamException.html" title="class in org.apache.commons.fileupload">MultipartStream.MalformedStreamException</A>,
                        <A HREF="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
<DL>
<DD><p>Reads <code>body-data</code> from the current
 <code>encapsulation</code> and writes its contents into the
 output <code>Stream</code>.

 <p>Arbitrary large amounts of data can be processed by this
 method using a constant size buffer. (see <A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#MultipartStream(java.io.InputStream, byte[], int, org.apache.commons.fileupload.MultipartStream.ProgressNotifier)"><CODE>constructor</CODE></A>).
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>output</CODE> - The <code>Stream</code> to write data into. May
               be null, in which case this method is equivalent
               to <A HREF="../../../../org/apache/commons/fileupload/MultipartStream.html#discardBodyData()"><CODE>discardBodyData()</CODE></A>.
<DT><B>Returns:</B><DD>the amount of data written.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.MalformedStreamException.html" title="class in org.apache.commons.fileupload">MultipartStream.MalformedStreamException</A></CODE> - if the stream ends unexpectedly.
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE> - if an i/o error occurs.</DL>
</DD>
</DL>
<HR>

<A NAME="discardBodyData()"><!-- --></A><H3>
discardBodyData</H3>
<PRE>
public int <B>discardBodyData</B>()
                    throws <A HREF="../../../../org/apache/commons/fileupload/MultipartStream.MalformedStreamException.html" title="class in org.apache.commons.fileupload">MultipartStream.MalformedStreamException</A>,
                           <A HREF="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
<DL>
<DD><p> Reads <code>body-data</code> from the current
 <code>encapsulation</code> and discards it.

 <p>Use this method to skip encapsulations you don't need or don't
 understand.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>The amount of data discarded.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.MalformedStreamException.html" title="class in org.apache.commons.fileupload">MultipartStream.MalformedStreamException</A></CODE> - if the stream ends unexpectedly.
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE> - if an i/o error occurs.</DL>
</DD>
</DL>
<HR>

<A NAME="skipPreamble()"><!-- --></A><H3>
skipPreamble</H3>
<PRE>
public boolean <B>skipPreamble</B>()
                     throws <A HREF="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
<DL>
<DD>Finds the beginning of the first <code>encapsulation</code>.
<P>
<DD><DL>

<DT><B>Returns:</B><DD><code>true</code> if an <code>encapsulation</code> was found in
         the stream.
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE> - if an i/o error occurs.</DL>
</DD>
</DL>
<HR>

<A NAME="arrayequals(byte[], byte[], int)"><!-- --></A><H3>
arrayequals</H3>
<PRE>
public static boolean <B>arrayequals</B>(byte[]&nbsp;a,
                                  byte[]&nbsp;b,
                                  int&nbsp;count)</PRE>
<DL>
<DD>Compares <code>count</code> first bytes in the arrays
 <code>a</code> and <code>b</code>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>a</CODE> - The first array to compare.<DD><CODE>b</CODE> - The second array to compare.<DD><CODE>count</CODE> - How many bytes should be compared.
<DT><B>Returns:</B><DD><code>true</code> if <code>count</code> first bytes in arrays
         <code>a</code> and <code>b</code> are equal.</DL>
</DD>
</DL>
<HR>

<A NAME="findByte(byte, int)"><!-- --></A><H3>
findByte</H3>
<PRE>
protected int <B>findByte</B>(byte&nbsp;value,
                       int&nbsp;pos)</PRE>
<DL>
<DD>Searches for a byte of specified value in the <code>buffer</code>,
 starting at the specified <code>position</code>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>value</CODE> - The value to find.<DD><CODE>pos</CODE> - The starting position for searching.
<DT><B>Returns:</B><DD>The position of byte found, counting from beginning of the
         <code>buffer</code>, or <code>-1</code> if not found.</DL>
</DD>
</DL>
<HR>

<A NAME="findSeparator()"><!-- --></A><H3>
findSeparator</H3>
<PRE>
protected int <B>findSeparator</B>()</PRE>
<DL>
<DD>Searches for the <code>boundary</code> in the <code>buffer</code>
 region delimited by <code>head</code> and <code>tail</code>.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>The position of the boundary found, counting from the
         beginning of the <code>buffer</code>, or <code>-1</code> if
         not found.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/MultipartStream.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../org/apache/commons/fileupload/InvalidFileNameException.html" title="class in org.apache.commons.fileupload"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/commons/fileupload/MultipartStream.IllegalBoundaryException.html" title="class in org.apache.commons.fileupload"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html?org/apache/commons/fileupload/MultipartStream.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="MultipartStream.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
Copyright &#169; 2002-2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>
